<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>js网页跳转</title>
    <script>
        var count = 6;
        var url = "https://www.sohu.com/a/339884382_500262";
        function myFunction()
        {
            count--;
            document.getElementById("demo").innerHTML="网页将在"+count+"秒后跳转至："+
            "<a href='https://www.sohu.com/a/339884382_500262'>https://www.sohu.com/a/339884382_500262</a>";
            if(count==0)
                location.href = url;
        }
        var x = window.setInterval(myFunction,1000);
        window.clearInterval();
    </script>
    <style type="text/css">
        p{
            text-align: center;
            border: 1px black solid;
            padding: 10px;
            color: white;
            background-color: black;
        }
        a{
            text-decoration: none;
            color: white;
        }
        a:hover{color: red;}
    </style>
    
</head>
<body>
    <p id="demo"></p>
</body>
</html>